<?php
/**
 * 特殊房间
 * lihuawei
 * 2020.10.29
 */
namespace App\Models\SociatyDB;

use Illuminate\Database\Eloquent\Model;

class SpecialRoom extends Model{

    protected $connection = 'mysql_sociaty';

    protected $table = 'sc_special_room';

    protected $primaryKey = 'id';

    protected $fillable = [
        'id',
        'room_id',
        'user_id',
        'remark',
        'add_time',
    ];

    public $timestamps = false;

    public function sociaty()
    {
        return $this->hasOne('App\Models\SociatyDB\Sociaty',  'room_id','room_id');
    }

    public function user_data()
    {
        return  $this->hasOne('App\Models\MainDB\UserData','user_id','user_id');
    }

    public function user_room()
    {
        return $this->hasOne('App\Models\MainDB\UserRoom', 'id', 'room_id');
    }

}